package be.rubengerits.bluetooth.tester.bluetooth;
import android.bluetooth.*;
import java.io.*;

public class StringBluetoothHandler extends BluetoothHandler {
	
	@Override
	public void write(Object o) throws IOException {
		String message = (String) o;
		getBluetoothSocket().getOutputStream().write(message.getBytes());
	}
	
	@Override
	public Object read(Object o) throws IOException {
		byte[] buffer = new byte[100];
		getBluetoothSocket().getInputStream().read(buffer);
		return new String(buffer);
	}
}
